package com.orhon.smartcampus.modules.baseinfo.entity;

import com.orhon.smartcampus.modules.base.entity.Schools;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;
@Setter
@Getter
@EqualsAndHashCode
@Entity
@Table(name = "baseinfo_timetable_item", schema = "smartcloud", catalog = "")
public class TimetableItem {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;
    
    @Column(name = "name", nullable = true, length = -1)
    private String name;
    
    @Column(name = "start_time", nullable = true, length = 0)
    private String startTime;
    
    @Column(name = "end_time", nullable = true, length = 0)
    private String endTime;
    
    @Column(name = "is_classtime", nullable = true)
    private Integer isClasstime;
    
    @Column(name = "type", nullable = false, length = 255)
    private String type;
    
    @Column(name = "weeks", nullable = true)
    private String weeks;
    
    @Column(name = "created_at", nullable = true)
    private Date createdAt;
    
    @Column(name = "updated_at", nullable = true)
    private Date updatedAt;
    
    @Column(name = "deleted_at", nullable = true)
    private Date deletedAt;

    @ManyToOne
    @JoinColumn(name = "timetable_id", referencedColumnName = "id")
    @Where(clause = "ISNULL(deleted_at)")
    @NotFound(action=NotFoundAction.IGNORE)
    private Timetable baseinfoTimetableByTimetableId;

}
